<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page import="com.jdbc.Jdbc"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="com.project.bean.*"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.List"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<%
	String classname = (String) request.getParameter("classname");
	String centername = (String) request.getParameter("centername");
	String find = "select*from class where classname='" + classname + "' and centername='" + centername + "'";
	Jdbc j = new Jdbc();
	ResultSet rs;
	List<Classes> list = new ArrayList<>();
	j.Jdbc_Q2(find);
	rs = j.rs;
	rs.next();
	Classes c = new Classes();
	c.setCentername(rs.getString("centername"));
	c.setClassesname(rs.getString("classname"));
	
	c.setFttime(rs.getString("fttime"));
	String Fttime=c.getFttime();
	String fweek=Fttime.substring(0, 2);
	String ftime=Fttime.substring(2, Fttime.length());
	String ftime_start=ftime.split("-")[0];
	String ftime_end=ftime.split("-")[1];
	
	c.setCttime(rs.getString("cttime"));
	String Cttime=c.getCttime();
	String cweek=Cttime.substring(0, 2);
	String ctime = Cttime.substring(2, Cttime.length());
	String ctime_start=ctime.split("-")[0];
	String ctime_end=ctime.split("-")[1];
	
	c.setFteacher(rs.getString("fteacher"));
	c.setCteacher(rs.getString("cteacher"));
	c.setClasslevel(rs.getString("classlevel"));
	c.setStartdate(rs.getString("startdate"));
	c.setEnddate(rs.getString("enddate"));
	c.setStunum(rs.getString("stunum"));
	c.setStunumrest(rs.getString("stunumrest"));
%>
<title>班级添加</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" href="./css/x-admin.css" media="all">
</head>
<body>
	<div class="x-body">
		<form class="layui-form" action="update_class" method="post">
			<div class="layui-form-item">
				<label for="L_email" class="layui-form-label"> <span
					class="x-red">*</span>分中心名称
				</label>
				<div class="layui-input-inline">
					<input type="text" id="centername" name="centername"
						class="layui-input" value="<%=c.getCentername() %>" readonly>
					<!-- <select class="layui-input" name="centername""><option
							selected="selected" value="">sss</option>
						<option value="SH001涞坊路">SH001涞坊路</option>
						<option value="SH002桃浦新村">SH002桃浦新村</option>
						<option value="SH003浦汇路">SH003浦汇路</option>
						<option value="SH004泗滨路">SH004泗滨路</option>
					</select> -->
				</div>

				<!-- <div class="layui-form-mid layui-word-aux">
					<span class="x-red">*</span>必填
				</div> -->
			</div>
			<div class="layui-form-item">
				<label for="L_email" class="layui-form-label"> <span
					class="x-red">*</span>班级名
				</label>
				<div class="layui-input-inline">
					<input type="text" name="classname" value="<%=c.getClassesname() %>"
						class="layui-input" readonly>
				</div>
				<!-- <div class="layui-form-mid layui-word-aux">
					<span class="x-red">*注意：只能使用字母数字和下划线“_” 如：“H1_001班”</span>
				</div> -->
			</div>
			<div class="layui-form-item">
				<label for="L_email" class="layui-form-label"> <span
					class="x-red">*</span>外教上课时间
				</label>
				<div class="layui-input-inline">
					<!-- <input type="date"  name="fttime"  required lay-verify="pass"
                         class="layui-input"> -->
					<select name="ftweek""><option selected="selected"
							required><%=fweek %></option>
						<option value="周一">周一</option>
						<option value="周二">周二</option>
						<option value="周三">周三</option>
						<option value="周四">周四</option>
						<option value="周五">周五</option>
						<option value="周六">周六</option>
						<option value="周日">周日</option>
					</select>

				</div>
				<label for="L_email" class="layui-form-label"> <span
					class="x-red">*</span>开始时间
				</label>
				<div class="layui-input-inline">
					<input type="text"  name="fttime_start" value="<%=ftime_start %>"
						required lay-verify="pass" class="layui-input">
				</div>

				<label for="L_email" class="layui-form-label"> <span
					class="x-red">*</span>结束时间
				</label>
				<div class="layui-input-inline">
					<input type="text"  name="fttime_end" value="<%=ftime_end %>"
						required lay-verify="pass" class="layui-input">
				</div>
			</div>
			<div class="layui-form-item">
				<label for="L_email" class="layui-form-label"> <span
					class="x-red">*</span>中教上课时间
				</label>
				<div class="layui-input-inline">
					<select name="ctweek""><option selected="selected"
							required><%=cweek %></option>
						<option value="周一">周一</option>
						<option value="周二">周二</option>
						<option value="周三">周三</option>
						<option value="周四">周四</option>
						<option value="周五">周五</option>
						<option value="周六">周六</option>
						<option value="周日">周日</option>
					</select>


				</div>
				<label for="L_email" class="layui-form-label"> <span
					class="x-red">*</span>开始时间
				</label>
				<div class="layui-input-inline">
					<div class="layui-input-inline">
						<input type="text"  name="cttime_start" value="<%=ctime_start%>"
							 class="layui-input">
					</div>


				</div>
				<label for="L_email" class="layui-form-label"> <span
					class="x-red">*</span>结束时间
				</label>
				<div class="layui-input-inline">
					<div class="layui-input-inline">
						<input type="text"  name="cttime_end" value="<%=ctime_end%>"
							 class="layui-input">
					</div>

				</div>
				<div class="layui-form-item">
					<label for="L_email" class="layui-form-label"> <span
						class="x-red">*</span>外教姓名
					</label>
					<div class="layui-input-inline">
						<!-- <input type="text"  name="fteachername"  required lay-verify="pass"
                         class="layui-input"> -->
						<select name="fteachername""><option selected="selected"
								><%=c.getFteacher() %></option>
							<option value="Oliver">Oliver</option>
							<option value="Akasha">Akasha</option>
							<option value="Julia">Julia</option>
							<option value="Azi">Azi</option>
							<option value="Philip">Philip</option>
							<option value="Anna">Anna</option>
							<option value="Biggie">Biggie</option>
							<option value="Jerry">Jerry</option>
							<option value="Will">Will</option>
							<option value="Michael">Michael</option>

						</select>
					</div>
					<div class="layui-form-mid layui-word-aux">
						<span class="x-red">*</span>必填
					</div>
				</div>
				<div class="layui-form-item">
					<label for="L_email" class="layui-form-label"> <span
						class="x-red">*</span>中教姓名
					</label>
					<div class="layui-input-inline">
						<!-- <input type="text"  name="cteachername"  required lay-verify="pass"
                         class="layui-input"> -->
						<select name="cteachername"">
							<option selected="selected"><%=c.getCteacher() %></option>
							<option value="Yasmine陈莹">Yasmine陈莹</option>
							<option value="Regina">Regina</option>
							<option value="Nichole">Nichole李婷婷</option>
							<option value="Ada袁晶晶">Ada袁晶晶</option>
							<option value="Lei和磊">Lei和磊</option>
							<option value="Tony王伯元">Tony王伯元</option>
							<option value="Carrol">Carrol</option>
							<option value="Maggie王楚蕊">Maggie王楚蕊</option>
							<option value="Amy陈丹丹">Amy陈丹丹</option>
							<option value="Lisa">Lisa</option>
							<option value="Nancy">Nancy</option>
							<option value="Bryce王依然">Bryce王依然</option>
							<option value="Wing">Wing</option>
							<option value="Wheeler彭飞">Wheeler彭飞</option>
							<option value="Abigail冯慧玲">Abigail冯慧玲</option>
							<option value="Sarah鲁梦珏">Sarah鲁梦珏</option>
							<option value="Crystal徐天心">Crystal徐天心</option>
							<option value="Luciya陶艳">Luciya陶艳</option>
							<option value="Eva庄磊">Eva庄磊</option>
							<option value="Juy周露鹭">Juy周露鹭</option>
							<option value="Fiona葛勤">Fiona葛勤</option>
							<option value="Lily胡丽丽">Lily胡丽丽</option>
							<option value="Amanda孙青">Amanda孙青</option>


						</select>
					</div>
					<div class="layui-form-mid layui-word-aux">
						<span class="x-red">*</span>必填
					</div>
				</div>
				<div class="layui-form-item">
					<label for="L_email" class="layui-form-label"> <span
						class="x-red">*</span>班级级别
					</label>
					<div class="layui-input-inline">
						<!-- <input type="text"  name="classlevel"  required lay-verify="pass"
                         class="layui-input"> -->
						<select name="classlevel""><option selected="selected"
								><%=c.getClasslevel() %></option>
							<option value="HATS1-K1">HATS1-K1</option>
							<option value="HATS2-K2">HATS2-K2</option>
							<option value="HATS3-K3">HATS3-K3</option>
							<option value="FANTASTIC1-P1">FANTASTIC1-P1</option>
							<option value="FANTASTIC2-P2">FANTASTIC2-P2</option>
							<option value="FANTASTIC3-P3">FANTASTIC3-P3</option>
							<option value="FANTASTIC4-P4">FANTASTIC4-P4</option>
							<option value="FANTASTIC5-P5">FANTASTIC5-P5</option>
							<option value="FANTASTIC6-P6">FANTASTIC6-P6</option>
							<option value="新概念1">新概念1</option>
							<option value="新概念2">新概念2</option>
							<option value="新概念3">新概念3</option>
							<option value="成人一对一">成人一对一</option>
							<option value="中教一对一">中教一对一</option>
							<option value="外教一对一">外教一对一</option>
							<option value="暑假班">暑假班</option>
							<option value="寒假班">寒假班</option>

						</select>
					</div>
					<div class="layui-form-mid layui-word-aux">
						<span class="x-red">*</span>必填
					</div>
				</div>
				<div class="layui-form-item">
					<label for="L_email" class="layui-form-label"> <span
						class="x-red">*</span>开班时间
					</label>
					<div class="layui-input-inline">
						<input type="date" name="startdate"  value=<%=c.getStartdate() %>
							class="layui-input">
					</div>
					<div class="layui-form-mid layui-word-aux">
						<span class="x-red">*</span>必填
					</div>
				</div>
				<div class="layui-form-item">
					<label for="L_email" class="layui-form-label"> <span
						class="x-red">*</span>结束时间
					</label>
					<div class="layui-input-inline">
						<input type="date" name="enddate" value=<%=c.getEnddate() %>
							class="layui-input">
					</div>
					<div class="layui-form-mid layui-word-aux">
						<span class="x-red">*</span>必填
					</div>
				</div>
				<div class="layui-form-item">
					<label for="L_email" class="layui-form-label"> <span
						class="x-red">*</span>班级人数
					</label>
					<div class="layui-input-inline">
						<input type="text" name="stunum" readonly value="<%=c.getStunum() %>"
							class="layui-input">
					</div>
					<div class="layui-form-mid layui-word-aux">
						<span class="x-red">*</span>必填
					</div>
				</div>
				<!-- 余下部分不需要 -->





				<div class="layui-form-item">
					<label for="L_repass" class="layui-form-label"> </label>
					<button class="layui-btn" lay-filter="add" lay-submit="">
						修改信息</button>
				</div>
		</form>
	</div>
	<script src="./lib/layui/layui.js" charset="utf-8">
		
	</script>
	<script src="./js/x-layui.js" charset="utf-8">
		
	</script>
	<!--         <script>
            layui.use(['form','layer'], function(){
                $ = layui.jquery;
              var form = layui.form()
              ,layer = layui.layer;
            
              //自定义验证规则
              form.verify({
                nikename: function(value){
                  if(value.length < 5){
                    return '昵称至少得5个字符啊';
                  }
                }
                ,pass: [/(.+){6,12}$/, '密码必须6到12位']
                ,repass: function(value){
                    if($('#L_pass').val()!=$('#L_repass').val()){
                        return '两次密码不一致';
                    }
                }
              });

              //监听提交
              form.on('submit(add)', function(data){
                console.log(data);
                //发异步，把数据提交给php
                layer.alert("增加成功", {icon: 6},function () {
                    // 获得frame索引
                    var index = parent.layer.getFrameIndex(window.name);
                    //关闭当前frame
                    parent.layer.close(index);
                });
                return false;
              });
              
              
            }); -->
	</script>
	<script>
		var _hmt = _hmt || [];
		(function() {
			var hm = document.createElement("script");
			var s = document.getElementsByTagName("script")[0];
			s.parentNode.insertBefore(hm, s);
		})();
	</script>
</body>
</html>